package test;

import resoft.jeasyform.event.EventHandler;
import resoft.jeasyform.components.Window;
import resoft.jeasyform.components.Component;
import resoft.jeasyform.components.SelectionField;

/**
 * <p></p>
 * User: albert
 * Date: Aug 27, 2007
 * Time: 7:39:15 PM
 */
public class UserCodePostEvent implements EventHandler {
    public boolean execute(Window window, Component source, int eventType) {
        String userCode = window.getValue("userCode");

        //window.findComponentByName("password").hide();
        //window.findComponentByName("org").hide();
        window.setMessage("Welcome " + userCode + " to login,plz input password now");
        //window.changeComponent("org","options","1:Intellij    IDEA;2:Eclipse;3:Netbean;4:JBuilder;5:Oracle JDeveloper");
        SelectionField orgComp = (SelectionField) window.findComponentByName("org");
        window.showMessageBox(orgComp.getText());
        return true;
//        } else {
//            window.setMessage("You can't use this username,plz try again");
//            return false;
//        }
    }
}
